//
//  UITextField+Chained.m
//  ObjectCChained
//
//  Created by sny on 2018/5/18.
//  Copyright © 2018年 HuangYangYang. All rights reserved.
//

#import "UITextField+Chained.h"

@implementation UITextField (Chained)

- (UITextField *(^)(NSString *,UIFont *,UIColor *))chianedTextSet {
    return ^UITextField *(NSString *placeholderText,UIFont *textFont,UIColor *textColor) {
        if (placeholderText) {self.placeholder = placeholderText;}
        if (textFont) {self.font = textFont;}
        if (textColor) {self.textColor = textColor;}
        return self;
    };
}

- (UITextField *(^)(NSTextAlignment))chianedTextAlignment {
    return ^UITextField *(NSTextAlignment textAlignment) {
        if (textAlignment) {self.textAlignment = textAlignment;}
        return self;
    };
}

- (UITextField *(^)(id))chianedUITextFieldDelegate {
    return ^UITextField *(id delegateObject) {
        if (delegateObject) {self.delegate = delegateObject;}
        return self;
    };
}

- (UITextField *(^)(UIView * , UITextFieldViewMode))chainedUITextFieldLeftViewSet {
    return ^UITextField *(UIView * leftView,UITextFieldViewMode leftViewMode) {
        if (leftView) {self.leftView = leftView;}
        if (leftViewMode) {self.leftViewMode = leftViewMode;}
        return self;
    };
}

- (UITextField *(^)(UIView * ,UITextFieldViewMode ))chainedUITextFieldRightViewSet {
    return ^UITextField *(UIView * rightView,UITextFieldViewMode rightViewMode) {
        if (rightView) {self.rightView = rightView;}
        if (rightViewMode) {self.rightViewMode = rightViewMode;}
        return self;
    };
}

- (UITextField *(^)(UITextBorderStyle))chainedUITextFieldBorderStyle {
    return ^UITextField *(UITextBorderStyle borderStyle) {
        self.borderStyle = borderStyle;
        return self;
    };
}

#pragma mark - setter

- (void)setChianedTextAlignment:(UITextField *(^)(NSTextAlignment))chianedTextAlignment {}

- (void)setChianedTextSet:(UITextField *(^)(NSString *, UIFont *, UIColor *))chianedTextSet {}

- (void)setChianedUITextFieldDelegate:(UITextField *(^)(id))chianedUITextFieldDelegate {}

- (void)setChainedUITextFieldLeftViewSet:(UITextField *(^)(UIView *, UITextFieldViewMode))chainedUITextFieldLeftViewSet {}

- (void)setChainedUITextFieldRightViewSet:(UITextField *(^)(UIView *, UITextFieldViewMode))chainedUITextFieldRightViewSet {}

-(void)setChainedUITextFieldBorderStyle:(UITextField *(^)(UITextBorderStyle))chainedUITextFieldBorderStyle {}


@end
